﻿#region Using Directives

    using System;

    using MarketPulse.BusinessLogic.Common;

#endregion

namespace MarketPulse.BusinessLogic.Private.StateMachine
{
    [Serializable]
    internal class AssignmentStateCreated : AssignmentStateBase
    {
        #region Constructors

            internal AssignmentStateCreated(bool throwIfInvalid) : base(throwIfInvalid)
            {
                mAssignmentStateType = AssignmentStatusTypeList.Created;
                InitAssignmentStateString();
            }

        #endregion

        #region Methods

            public override bool Release(IAssignmentStateContext context, bool tryTransition)
            {
                if (!tryTransition)
                {
                    context.SetState(new AssignmentStateReleased(mThrowIfInvalid));
                }
                return true;
            }

        #endregion

    }
}
